Skip to content
This repository was archived by the owner on Jul 27, 2023. It is now read-only.

Conversation

@geriux
Copy link

@geriux geriux commented Sep 23, 2022

Description

This PR updates the wp-fork branch with upstream version 2.5.0 and applies the required changes to publish the Android library associated with the package.

Since the PR contains a massive amount of changed files, in order to review this PR, it's better to compare the branch with the upstream repository and validate that we apply the same changes we have in wp-fork:

NOTE: Once this PR is ready, we should also merge #24 so the diff showed in wp-fork doesn't contain the 2.5.0 version changes.

ghorbani-m and others added 30 commits March 16, 2022 10:40
…#1942)

- Update @react-navigation version to remove warnings.
- Fix bugs in example/bottom_sheet
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…#1949)

Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Adds basic web support for `GestureDetector` using the existing web implementation.

Fixes software-mansion#1869 and software-mansion#1840.
…es (software-mansion#1959)

This PR https://github.com/software-mansion/react-native-gesture-handler/pull/1844/files#diff-b55cdbef4907b7045f32cc5360d48d262cca5f94062e353089f189f4460039e0 added `node` to the `types` array of `tsconfig`. This causes all of the React Native projects with `gesture-handler` as dependency to get Node typings to their project and node has conflicting types with Dom on `setTimeout`.

This PR gets rid of the `node` typing and adds a new file which adds missing types to gesture handler project.

Long story short:
🔴 We were requiring the whole NodeJS types just because we wanted to use process.env.JEST_WORKER_ID
✅ Fixed by not requiring NodeJS types and just typed out the process.env.JEST_WORKER_ID

Fixes software-mansion#1958
Update `maxDurationMs` to `maxDuration` in the tap gesture documentation description and example.
…1963)

`accessibilityActions` and `onAccessibilityAction` properties weren't passed to the internal `Animated.View` component, making the component not supporting the accessibility actions.
)

Rename `RNTouchEventType` to `RNGHTouchEventType` to be more consistent with the rest of the package.
Before 0d1a917 there was a method responsible for sending each type of event, however `sendStateChangeEvent` was used to send all of them. In 0d1a917 the redundant methods were removed, but the name remained.
This PR changes the name of `sendStateChangeEvent` to `sendEvent` on iOS with hope that it will be (slightly) less confusing.
Rename `EventType.ts` file to `TouchEventType.ts` and `EventType` to `TouchEventType` in code.
(Mostly) fixes software-mansion#1467.

We use some methods that were deprecated in RN, mostly related to the new Fabric architecture.
One remaining warning is caused by incompatible Kotlin libraries versions, which we should fix at some point:
```
w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
    /Users/jgonet/.gradle/caches/transforms-2/files-2.1/5cd2a7902e175e6b0e460fb9bb363780/jetified-kotlin-stdlib-jdk8-1.4.10.jar (version 1.4)
    /Users/jgonet/.gradle/caches/transforms-2/files-2.1/3475e517b1c5de08a7eafa4a6bfa39b7/jetified-kotlin-stdlib-jdk7-1.4.10.jar (version 1.4)
    /Users/jgonet/.gradle/caches/transforms-2/files-2.1/0453d761ea1687f9fa81ff21f9658d1a/jetified-kotlin-stdlib-1.5.20.jar (version 1.5)
    /Users/jgonet/.gradle/caches/transforms-2/files-2.1/893d996fbd64b35f010b04ebd97c0b19/jetified-kotlin-stdlib-common-1.5.20.jar (version 1.5)
w: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath
```
…1929)

Don't rely on Reanimated for receiving events when using remote debugging, as it's not supported by Reanimated 2.

Should fix software-mansion#1797.
Should fix software-mansion#1883.

I managed to (kind of and by accident) reproduce the crash mentioned in the issue when I was working on software-mansion#1912. After commenting out [those lines](https://github.com/software-mansion/react-native-gesture-handler/pull/1912/files#diff-0c167f367b6ea1c2605e4c3ec7d9ea7edd077697285273e4e5e5721c9248591cR22-R23), I tapped the view that had a `Pan` gesture attached with `manualActivation` set to true. After that going to a different screen caused the crash.

The issue comes from the fact that some gestures try to send events in their `reset` method to properly close the state flow, however this method is also called when the view is unmounted and all gesture recognizers get unbound from the view. This PR adds a simple check to see if the `reactTag` property is `nil` or not before sending the event. Events are send only when their target is not `nil` which prevents the crash.
…n#1936)

`tryInitializeHandlerForReactRootView` was causing crashes, especially with combination with CodePush. `RNGestureHandlerEnabledRootView` was deprecated in version 2.0.0 in favor of `GestureHandlerRootView` component and this PR removes implementation of `RNGestureHandlerEnabledRootView` and code responsible for interactions with it.
Adds a new page in docs explaining how to migrate to `GestureHandlerRootView`.

Potentially fixes software-mansion#1675.
…n#1965)

Restore section about installation alongside `wix/react-native-navigation` in the docs.
…-mansion#1966)

Update version of React Native in FabricExample to 0.68.0-rc.4.
- Fix codegen configuration: mark all props as optional and set default values for `exclusive` and `enabled`
- Add `updateProps` method for `GestureHandlerButton` on iOS that passes props to the underlying `Button` implementation
Fix `Podfile.lock` in FabricExample
…on#1969)

Bumps [ansi-regex](https://github.com/chalk/ansi-regex) from 4.1.0 to 4.1.1.
- [Release notes](https://github.com/chalk/ansi-regex/releases)
- [Commits](chalk/ansi-regex@v4.1.0...v4.1.1)

---
updated-dependencies:
- dependency-name: ansi-regex
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [plist](https://github.com/TooTallNate/node-plist) from 3.0.4 to 3.0.5.
- [Release notes](https://github.com/TooTallNate/node-plist/releases)
- [Changelog](https://github.com/TooTallNate/plist.js/blob/master/History.md)
- [Commits](https://github.com/TooTallNate/node-plist/commits)

---
updated-dependencies:
- dependency-name: plist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [plist](https://github.com/TooTallNate/node-plist) from 3.0.4 to 3.0.5.
- [Release notes](https://github.com/TooTallNate/node-plist/releases)
- [Changelog](https://github.com/TooTallNate/plist.js/blob/master/History.md)
- [Commits](https://github.com/TooTallNate/node-plist/commits)

---
updated-dependencies:
- dependency-name: plist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [ansi-regex](https://github.com/chalk/ansi-regex) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/chalk/ansi-regex/releases)
- [Commits](chalk/ansi-regex@v3.0.0...v3.0.1)

---
updated-dependencies:
- dependency-name: ansi-regex
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Fixes software-mansion#544.

Some Android-only props were missing from `BaseButton` type: `rippleRadius`, `borderless` and `foreground`. This PR adds them.
Bumps [plist](https://github.com/TooTallNate/node-plist) from 3.0.4 to 3.0.5.
- [Release notes](https://github.com/TooTallNate/node-plist/releases)
- [Changelog](https://github.com/TooTallNate/plist.js/blob/master/History.md)
- [Commits](https://github.com/TooTallNate/node-plist/commits)

---
updated-dependencies:
- dependency-name: plist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
j-piasecki and others added 17 commits June 13, 2022 21:56
…#2103)

Gesture Handler relied on `Touchable.TOUCH_TARGET_DEBUG` to render the debug view of the touchables, but this property was removed in facebook/react-native@ef765d4. Touchables from React Native have been using [`PressabilityDebugView`](https://github.com/facebook/react-native/blob/c80309e5ae66d651c4dabcd5c0b4ec912797c9fd/Libraries/Components/Touchable/TouchableWithoutFeedback.js#L103-L105). This PR replaces `Touchable.renderDebugView` and `Touchable.TOUCH_TARGET_DEBUG` with `PressabilityDebugView` ([it handles rendering only when the inspector is enabled under the hood](https://github.com/facebook/react-native/blob/c80309e5ae66d651c4dabcd5c0b4ec912797c9fd/Libraries/Pressability/PressabilityDebug.js#L40)).

Fixes software-mansion#2100.
…nsion#2059)

This PR:
- changes how the absolute position is calculated in `FlingGestureRecognizer`, for some reason the method used by other recognizers returns (0, 0)
- change how the relative position is obtained: At the moment we rely on `locationInView` but it returns the same coordinates, no matter the state. I changed it to using the position of the recently updated pointer, which should be enough for this gesture, as it's most likely to be used when checking the direction.
- adds `triggerAction` and calls it in `touchesBegan` and `reset` to send `BEGAN` and `FAILED` events

Fixes software-mansion#1326.
… `TextInput` (software-mansion#2017)

This PR makes use of extension mechanism from software-mansion#2016 to make `TextInput` behave more similarly to iOS when wrapped with other gesture handlers.
…s='box-none'` (software-mansion#2024)

As described in the [docs](https://reactnative.dev/docs/view#pointerevents), when a view has `pointerEvents` prop set to `box-none` then it will never be a touch target but its children might be. Current implementation ignores gestures attached to the view with `pointerEvents='box-none'` entirely, even if its child is handling events, contrary to how it works on iOS where the gestures attached to parent will also work on the child view (but not on the parent).

This PR changes implementation of the view traversing algorithm to also extract gestures from a view with `pointerEvents='box-none'` when the target of a touch is its descendant.

Fixes software-mansion#1575. Supersedes software-mansion#1710.
…n#2096)

This PR will fix android compile error Type mismatch: inferred type is Context? but Context was expected
…n#1938)

Since the release of Gesture Handler 2.0, it's been relatively easy to implement `LongPress` before `Pan` using `manualActivation` and touch events, however this approach adds a lot of unnecessary boilerplate code and may not seem obvious when tackling this problem.
This PR adds `activteAfterLongPress` modifier to `Pan` gesture, making it very easy to make `Pan` gesture activate only after `LongPress` of specified duration.
On iOS when using `manualActivation`, the gesture would receive `ACTIVATE` event when the state wasn't changed. It happened because the `UIGestureRecognizer` used to prevent it from activating would fail, fulfilling the requirement of `shouldBeRequiredToFailByGestureRecognizer`. This PR changes the behavior of the blocker to activate instead of failing, thus causing the blocked gesture to fail if it wasn't activated manually.

Fixes software-mansion#1865.
…oftware-mansion#2047)

- adds `touchSoundDisabled` prop to GestureHandlerButton (and Touchables) that maps to the `isSoundEffectsEnabled` property of `View`
- moves freeing responder from `afterGestureEnd` to `setPressed(pressed)` when `pressed` is `false`. `afterGestureEnd` was called too early when the inner button was pressed and both buttons were able to grab the responder in sequence.
- checks if there are children buttons pressed before performing click to prevent clicking on inner button activating the sound effect of the outer one

Fixes software-mansion#2042
`PressabilityDebugView` is not implemented in `react-native-web` so importing it in `createHandler.tsx` was causing errors on web. This PR moves the import to a separate file with a web-specific version that returns `null`, thus preventing errors.

I also added the `key` property when rendering the `PressabilityDebugView` to prevent errors about it.
…e-mansion#2053)

- upgrade FabricExample to use React Native 0.69.0
- fix GH compatibility with RN 0.69

Also adds `mkdirp` as a dev dependency to FabricExample because it's used by some RN script but it's not anywhere in the dependencies and CI was failing because of that.
# Conflicts:
#	package.json
@geriux
Copy link
Author

geriux commented Oct 10, 2022

NOTE: Before merging we need to update this line with the correct published Reanimated version.

Copy link

@derekblank derekblank left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, pending updating the new published reanimated version. 👍 🚀

@geriux
Copy link
Author

geriux commented Oct 11, 2022

LGTM, pending updating the new published reanimated version. 👍 🚀

Thanks for the reminder! Updated in 3fafdab

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.